<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>

<?php
$form = $this->form;
$form->prepare();
$form->setAttributes(['class' => 'form-horizontal']);

$form->get('loginAccount')->setAttributes([
    'class' => 'form-control',
    'placeholder' => $this->translate('登录账号')
]);
$form->get('loginPassword')->setAttributes([
    'class' => 'form-control',
    'placeholder' => $this->translate('登录密码')
]);
?>

<div class="container">
    <div class="xm-plain-box">
        <div class="box-hd">
            <h3 class="title"><?php echo $this->translate('绑定现有会员'); ?></h3>
        </div>
        <div class="box-bd">
            <div class="row">
                <?php echo $this->partial('shop/message'); ?>

                <?php echo $this->form()->openTag($form); ?>
                <?php echo $this->formElement($form->get('shopCsrf')); ?>
                <?php echo $this->formElementErrors($form->get('shopCsrf'), ['class'=>'error-message']); ?>
                <div class="control-group">
                    <label for="input01" class="control-label"><?php echo $this->translate('登录账号'); ?>：</label>
                    <div class="controls">
                        <?php echo $this->formElement($form->get('loginAccount')); ?>
                        <?php echo $this->formElementErrors($form->get('loginAccount'), ['class'=>'error-message']); ?>
                    </div>
                </div>
                <div class="control-group">
                    <label for="input01" class="control-label"><?php echo $this->translate('登录密码'); ?>：</label>
                    <div class="controls">
                        <?php echo $this->formElement($form->get('loginPassword')); ?>
                        <?php echo $this->formElementErrors($form->get('loginPassword'), ['class'=>'error-message']); ?>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button class="btn btn-primary" type="submit"><?php echo $this->translate('提交(绑定现有账户)'); ?></button>
                        &nbsp;&nbsp;
                        <button class="btn" type="button" onclick="location.href='<?php echo $this->url('shop-user', ['action' => 'otherUserRegister', 'id' => $this->loginType]); ?>'"><?php echo $this->translate('点击建立新账户'); ?></button>
                    </div>
                </div>
                <?php echo $this->form()->closeTag(); ?>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                loginAccount: {
                    required: true
                },
                loginPassword: {
                    required: true
                }
            },
            messages: {
                loginAccount: {
                    required: "<?php echo $this->translate('请输入登录账户信息!'); ?>"
                },
                loginPassword: {
                    required: "<?php echo $this->translate('请输登录密码!'); ?>"
                }
            }
        });
    });
</script>
